import { useCache } from '@/hooks/web/useCache'

const TOKEN_KEY = 'www_token'

export function getToken() {
  const { wsCache } = useCache()

  return wsCache.get(TOKEN_KEY)
}

export function setToken(token: string) {
  const { wsCache } = useCache()
  // 设置token
  wsCache.set(TOKEN_KEY, token)
}

export function cleanToken() {
  const { wsCache } = useCache()
  // 设置token
  wsCache.delete(TOKEN_KEY)
}